package service.factory;

import library.service.LibraryService;

import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceFactory;
import org.osgi.framework.ServiceRegistration;

import service.impl.MedicalLibraryServiceImpl;

public class MedicalLibraryServiceFactory implements ServiceFactory {

	public Object getService(Bundle bundle,
			ServiceRegistration serviceRegistration) {
		LibraryService medicalLibraryService = new MedicalLibraryServiceImpl();

		System.out.println("[LibraryServiceFactory] getService from bundle:"
				+ bundle.getLocation());
		System.out.println("serviceRegistration: " + serviceRegistration);

		return (LibraryService) medicalLibraryService;
	}

	public void ungetService(Bundle bundle, ServiceRegistration registration,
			Object service) {
		System.out.println("[LibraryServiceFactory] ungetService from bundle: "
				+ bundle.getLocation());
	}
}
